﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace OpenServe.Net.Library.Base {
    public class osUser {
        public Guid GUID { get; set; }
        public string Username { get; set; }
        public string Password { get; set; }
        public List<osUserRole> Roles { get; set; }
        public List<osUserPermission> Permissions { get; set; }
        public osUser() {
            Roles = new List<osUserRole>();
            Permissions = new List<osUserPermission>();
        }
    }
    public class osUserRole {
        public List<osUserPermission> Permissions { get; set; }
        public osUserRole() {
            Permissions = new List<osUserPermission>();
        }
    }
    public class osUserPermission {
        public Permission Permission { get; set; }
        public PermissionType Permitted { get; set; }
    }

    public enum PermissionType {
        CanRead = 1,
        CanWrite = 2,
    }

    public enum Permission {
        UserAddRole,
        UserRemoveRole,
        UserAddPermission,
        UserRemovePermission,
    }
}
